//
//  DownloadedChapterCell.m
//  ZYTS-iPhone
//
//  Created by yuzhou on 12-12-12.
//  Copyright (c) 2012年 wzyk. All rights reserved.
//

#import "DownloadedChapterCell.h"

@implementation DownloadedChapterCell

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        // Initialization code
    }
    return self;
}

- (void)updateDisplay
{
    titleLabel.text = [self.chapterInfo valueForKey:@"sub_name"];
    int filesize = [[self.chapterInfo valueForKey:@"file_size"] intValue];
    timeLabel.text = [NSString stringWithFormat:@"%.1fM",filesize/1024.00/1024.00];
    if (self.chapterIndex%2 == 0) {
        self.contentView.backgroundColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.1];
    }
    else {
        self.contentView.backgroundColor = [UIColor colorWithRed:1 green:1 blue:1 alpha:0.1];
    }
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (void)dealloc {
    [titleLabel release];
    [timeLabel release];
    [_chapterInfo release];
    [super dealloc];
}
@end
